﻿namespace FitnessTracker.Packet
{
    using System;

    public class HxMPacket
    {
        private readonly HxMPacketHeader header;
        private readonly HxMPacketPayload payload;
        
        public HxMPacket(byte[] buffer)
        {
            this.header = new HxMPacketHeader(buffer);
            this.payload = new HxMPacketPayload(buffer);
        }

        public HxMPacketHeader Header
        {
            get
            {
                return this.header;
            }
        }

        public HxMPacketPayload Payload
        {
            get
            {
                return this.payload;
            }
        }

        public override string ToString()
        {
            return this.Header + Environment.NewLine + this.Payload;
        }
    }
}
